#ifndef DIALOG_CAMADJUST_H
#define DIALOG_CAMADJUST_H

#include <QDialog>
#include <QTimer>

namespace Ui {
class Dialog_camAdjust;
}

class Dialog_camAdjust : public QDialog
{
    Q_OBJECT

public:
    explicit Dialog_camAdjust(QWidget *parent = nullptr);
    ~Dialog_camAdjust();
    QByteArray formSetData(int speed,int angle,int radio);
    QByteArray intToByteArray(int value);
    void SetAngle(int16_t angle);

    static int topCamadjustValue;
    static int sideCamadjustValue;
signals:
    void sendTopAdjustData(QByteArray dat);
    void sendSideAdjustData(QByteArray dat);
public slots:
    void getTopRecv(QByteArray data);
    void getSideRecv(QByteArray data);

    void do_disableAngleSet(bool state);
//    void sendSideFormSetData(int16_t angle);
    //    void sendTopFormSetData(int16_t angle);
    void do_btn_angle_add(const uint16_t angleAdd);
    void do_btn_angle_subtract(const uint16_t angleSub);
private slots:
    void on_btn_ok_clicked();

    void on_btn_cancel_clicked();

//    void on_btn_set_clicked();

    void on_btn_angle_subtract_clicked();

    void on_btn_angle_add_clicked();
protected:
    void mousePressEvent(QMouseEvent *event) override;
private:
    Ui::Dialog_camAdjust *ui;

    QTimer *m_btn_timer = nullptr;

    int m_speed = 100;
    int m_radio = 16384;
    int m_angle;

    int m_currentAngle;
//    QString m_AngleMinVal = "0";
//    QString m_AngleMaxVal = "360";
};

#endif // DIALOG_CAMADJUST_H
